package com.hooda.session;

import com.hooda.config.XmlConfigBuilder;
import com.hooda.pojo.Configuration;
import org.dom4j.DocumentException;

import java.beans.PropertyVetoException;
import java.io.InputStream;

/**
 * @author zhangzp
 * @version 1.0, 2021/7/29
 */
public class SqlSessionFactoryBuilder {

    public SqlSessionFactory build(InputStream in) throws PropertyVetoException, DocumentException {
        Configuration configuration = new XmlConfigBuilder().parseConfig(in);
        return new DefaultSqlSessionFactory(configuration);
    }
}
